home *** CD-ROM | disk | FTP | other *** search
- /*
- * Blob ManagerDemo: Random word picker
- */
-
- # include "BlobMgr.h"
- # include "BlobDemo.h"
-
-
- # define maxWords 700
-
-
- static unsigned char *word[] =
- {
- "\paback",
- "\pabalone",
- "\pabandon",
- "\pabase",
- "\paccent",
- "\paccentuate",
- "\paccept",
- "\pacerbic",
- "\pacrobat",
- "\padage",
- "\padagio",
- "\padamant",
- "\padapt",
- "\padaptation",
- "\paegis",
- "\paeolian",
- "\paerate",
- "\paerial",
- "\paerobic",
- "\pairborne",
- "\paircraft",
- "\pallied",
- "\palligator",
- "\palliterate",
- "\pallocate",
- "\pambuscade",
- "\pambush",
- "\pameliorate",
- "\pamen",
- "\pamend",
- "\pangelfish",
- "\pangelic",
- "\panger",
- "\pangiosperm",
- "\pangle",
- "\pantler",
- "\panvil",
- "\panxiety",
- "\panxious",
- "\papproximate",
- "\papricot",
- "\papron",
- "\papropos",
- "\papse",
- "\parrangeable",
- "\parray",
- "\parrear",
- "\parrest",
- "\parrival",
- "\passignation",
- "\passignee",
- "\passimilate",
- "\passist",
- "\paudible",
- "\paudience",
- "\paudio",
- "\paudiotape",
- "\paudiovisual",
- "\paxiomatic",
- "\paxis",
- "\paxisymmetric",
- "\paxle",
- "\paxon",
- "\pbamboo",
- "\pbanal",
- "\pbanana",
- "\pband",
- "\pbasilar",
- "\pbasilisk",
- "\pbasin",
- "\pbasis",
- "\pbask",
- "\pbedroom",
- "\pbedside",
- "\pbedspread",
- "\pbedspring",
- "\pbedstraw",
- "\pbenevolent",
- "\pbenight",
- "\pbenign",
- "\pbent",
- "\pbenthic",
- "\pbifocal",
- "\pbifurcate",
- "\pbigotry",
- "\pbivalve",
- "\pbivouac",
- "\pbizarre",
- "\pbluebill",
- "\pbluebird",
- "\pbluebonnet",
- "\pbluebook",
- "\pbluebush",
- "\pbookish",
- "\pbookkeep",
- "\pbooklet",
- "\pbookplate",
- "\pbookseller",
- "\pbrae",
- "\pbrag",
- "\pbragging",
- "\pbraid",
- "\pbrain",
- "\pbring",
- "\pbrink",
- "\pbriny",
- "\pbrisk",
- "\pbugle",
- "\pbuild",
- "\pbuildup",
- "\pbuilt",
- "\pbuiltin",
- "\pbutene",
- "\pbutler",
- "\pbutte",
- "\pcaliph",
- "\pcalisthenic",
- "\pcall",
- "\pcalumny",
- "\pcalypso",
- "\pcamera",
- "\pcamouflage",
- "\pcandlestick",
- "\pcapacitive",
- "\pcapacity",
- "\pcape",
- "\pcapella",
- "\pcartwheel",
- "\pcarve",
- "\pcascade",
- "\pcedilla",
- "\pceil",
- "\pcelandine",
- "\pcelebrant",
- "\pcelebrate",
- "\pchangeable",
- "\pchangeover",
- "\pchannel",
- "\pchant",
- "\pchicory",
- "\pchide",
- "\pchief",
- "\pchiefdom",
- "\pchieftain",
- "\pclassmate",
- "\pclassroom",
- "\pclassy",
- "\pclatter",
- "\pclattery",
- "\pcoachwork",
- "\pcoadjutor",
- "\pcoagulable",
- "\pcola",
- "\pcolander",
- "\pcolatitude",
- "\pcold",
- "\pcoleus",
- "\pcommit",
- "\pcommittable",
- "\pconceal",
- "\pconcede",
- "\pconceit",
- "\pconceive",
- "\pconcentrate",
- "\pcongener",
- "\pcongenital",
- "\pcongest",
- "\pcongestion",
- "\pcontaminant",
- "\pcontemplate",
- "\pcontemporary",
- "\pcontempt",
- "\pcool",
- "\pcoolant",
- "\pcoolheaded",
- "\pcoon",
- "\pcoop",
- "\pcosine",
- "\pcosmetic",
- "\pcosmic",
- "\pcosmology",
- "\pcowlick",
- "\pcoworker",
- "\pcowpea",
- "\pcrevice",
- "\pcrew",
- "\pcrewcut",
- "\pcrewel",
- "\pcrewman",
- "\pcubbyhole",
- "\pcube",
- "\pcubic",
- "\pcybernetics",
- "\pcycle",
- "\pcyclic",
- "\pcyclist",
- "\pdeadwood",
- "\pdeaf",
- "\pdeafen",
- "\pdeal",
- "\pdeallocate",
- "\pdeduce",
- "\pdeducible",
- "\pdeduct",
- "\pdeductible",
- "\pdeed",
- "\pdelusive",
- "\pdeluxe",
- "\pdelve",
- "\pdemagnify",
- "\pdemagogue",
- "\pdepute",
- "\pdeputy",
- "\pderail",
- "\pderange",
- "\pderate",
- "\pdeviate",
- "\pdevice",
- "\pdevil",
- "\pdevilish",
- "\pdevious",
- "\pdiffusive",
- "\pdifluoride",
- "\pdigest",
- "\pdigestible",
- "\pdisembowel",
- "\pdisgruntle",
- "\pdisgustful",
- "\pdish",
- "\pdishevel",
- "\pdockyard",
- "\pdoctor",
- "\pdoctoral",
- "\pdoctorate",
- "\pdoctrinaire",
- "\pdowitcher",
- "\pdown",
- "\pdowncast",
- "\pdowndraft",
- "\pdrought",
- "\pdrove",
- "\pdrown",
- "\pdrowse",
- "\pdrowsy",
- "\pdyspeptic",
- "\pdysplasia",
- "\pdysprosium",
- "\pdystrophy",
- "\peffluent",
- "\peffort",
- "\peffusive",
- "\pelution",
- "\pelves",
- "\pelysian",
- "\pemaciate",
- "\pencompass",
- "\pencore",
- "\pencounter",
- "\pencourage",
- "\pencroach",
- "\pentrap",
- "\pentrapping",
- "\pentreat",
- "\pentreaty",
- "\pentree",
- "\pergodic",
- "\perode",
- "\perodible",
- "\perosible",
- "\perosion",
- "\pevaporate",
- "\pevasion",
- "\pevasive",
- "\peven",
- "\pexempt",
- "\pexemption",
- "\pexercisable",
- "\pexercise",
- "\pexert",
- "\pexpressway",
- "\pexpropriate",
- "\pexpulsion",
- "\pexpunge",
- "\pexpurgate",
- "\pfair",
- "\pfairgoer",
- "\pfairway",
- "\pfairy",
- "\pfaith",
- "\pfederal",
- "\pfibula",
- "\pfiesta",
- "\pfife",
- "\pfifteen",
- "\pfifth",
- "\pfixate",
- "\pfixture",
- "\pfloor",
- "\pfloorboard",
- "\pfloppy",
- "\pfoolproof",
- "\pfootball",
- "\pfootbridge",
- "\pfootfall",
- "\pfoothill",
- "\pfootman",
- "\pfountain",
- "\pfountainhead",
- "\pfour",
- "\pfourfold",
- "\pfoursome",
- "\pfritillary",
- "\pfritter",
- "\pfrivolity",
- "\pgabardine",
- "\pgastronomy",
- "\pgate",
- "\pgesticulate",
- "\pgesture",
- "\pgetaway",
- "\pgetting",
- "\pgloat",
- "\pglob",
- "\pglobal",
- "\pgorilla",
- "\pgoshawk",
- "\pgreater",
- "\pgrebe",
- "\pgreed",
- "\pgreedy",
- "\pgreen",
- "\pguidance",
- "\pguide",
- "\pguidebook",
- "\pguideline",
- "\pguidepost",
- "\phailstorm",
- "\phair",
- "\phaircut",
- "\phairdo",
- "\phairpin",
- "\pharem",
- "\phark",
- "\pharm",
- "\pharmful",
- "\pharmonic",
- "\pheave",
- "\pheaven",
- "\pheavenward",
- "\pheavy",
- "\pheavyweight",
- "\phero",
- "\pheroic",
- "\phistorian",
- "\phistory",
- "\phood",
- "\phoodlum",
- "\phoofmark",
- "\phook",
- "\phubby",
- "\phymnal",
- "\phyperbola",
- "\pillustrious",
- "\pimage",
- "\pimaginary",
- "\pimposition",
- "\pimpossible",
- "\pimposture",
- "\pimpotent",
- "\pinclude",
- "\pincoherent",
- "\pincome",
- "\pineducable",
- "\pineffable",
- "\pineffective",
- "\pineffectual",
- "\pinfringe",
- "\pinfuriate",
- "\pinfuse",
- "\pinsightful",
- "\pinsignia",
- "\pinsincere",
- "\pinsinuate",
- "\pinsipid",
- "\pinterstitial",
- "\pinterval",
- "\pionosphere",
- "\piota",
- "\pjalopy",
- "\pjamboree",
- "\pjudge",
- "\pjudicature",
- "\pjudicial",
- "\pkeyword",
- "\pkhaki",
- "\pkibbutzim",
- "\plark",
- "\plarkspur",
- "\plarva",
- "\pleatherwork",
- "\pleave",
- "\pleaven",
- "\pliberal",
- "\pliberate",
- "\pliberty",
- "\pliquidate",
- "\plist",
- "\plonesome",
- "\plong",
- "\plongevity",
- "\plonghand",
- "\plonghorn",
- "\plunar",
- "\plunatic",
- "\plunch",
- "\pmaidservant",
- "\pmail",
- "\pmailbox",
- "\pmalice",
- "\pmansion",
- "\pmastiff",
- "\pmastodon",
- "\pmatch",
- "\pmatchbook",
- "\pmegalomaniac",
- "\pmetalwork",
- "\pmetamorphic",
- "\pmetaphor",
- "\pmillennium",
- "\pmiller",
- "\pmillet",
- "\pmoan",
- "\pmoat",
- "\pmonth",
- "\pmonument",
- "\pmood",
- "\pmuffin",
- "\pmuffle",
- "\pmyocardium",
- "\pmyopia",
- "\pneedful",
- "\pneedle",
- "\pneedlepoint",
- "\pnightmare",
- "\pnightshirt",
- "\pnighttime",
- "\pnihilism",
- "\pnoteworthy",
- "\pnothing",
- "\pnotice",
- "\pnoticeable",
- "\pnotify",
- "\pobjector",
- "\pobligatory",
- "\poblige",
- "\pofficious",
- "\poffset",
- "\popposition",
- "\poppress",
- "\postentatious",
- "\posteology",
- "\ppalette",
- "\ppalindrome",
- "\ppalisade",
- "\pparaxial",
- "\pparboil",
- "\pparcel",
- "\pparch",
- "\ppardon",
- "\ppathology",
- "\ppathway",
- "\ppatient",
- "\ppellagra",
- "\ppellet",
- "\ppelt",
- "\ppelvic",
- "\pperiwinkle",
- "\pperjure",
- "\pperjury",
- "\pperk",
- "\pphantom",
- "\ppharmacist",
- "\ppiety",
- "\ppigeon",
- "\pplacebo",
- "\pplaceholder",
- "\pplacenta",
- "\pplowshare",
- "\ppluck",
- "\pplug",
- "\ppolymorphic",
- "\ppolynomial",
- "\ppolyphony",
- "\ppolytechnic",
- "\ppostman",
- "\ppostmark",
- "\ppostmortem",
- "\ppreen",
- "\pprefabricate",
- "\ppreface",
- "\pprincess",
- "\pprinciple",
- "\pprint",
- "\pprompt",
- "\ppromulgate",
- "\pprone",
- "\pprong",
- "\pprovidential",
- "\pprovince",
- "\pprovision",
- "\ppunt",
- "\ppuny",
- "\ppupal",
- "\pquantum",
- "\pquarantine",
- "\pquark",
- "\pquarrel",
- "\pquiet",
- "\pradio",
- "\pradioactive",
- "\pradiocarbon",
- "\praucous",
- "\pravel",
- "\praven",
- "\predactor",
- "\predcoat",
- "\predden",
- "\preliant",
- "\prelic",
- "\prelieve",
- "\prescind",
- "\prescue",
- "\presemble",
- "\present",
- "\pretrovision",
- "\preturn",
- "\preveal",
- "\prevelation",
- "\prightward",
- "\prigid",
- "\prigorous",
- "\prill",
- "\prose",
- "\prosebud",
- "\prosebush",
- "\prosette",
- "\prusset",
- "\prust",
- "\prustic",
- "\prustle",
- "\psalvo",
- "\psame",
- "\psaxophone",
- "\pscabbard",
- "\pscout",
- "\pscowl",
- "\pscraggly",
- "\pscram",
- "\psecrecy",
- "\psecret",
- "\psecretarial",
- "\pseparate",
- "\pshaky",
- "\pshale",
- "\pshallot",
- "\pshoemaker",
- "\pshoestring",
- "\pshone",
- "\psideboard",
- "\psidecar",
- "\psidelight",
- "\psideline",
- "\psingsong",
- "\psingular",
- "\psinistral",
- "\pslander",
- "\pslang",
- "\pslant",
- "\pslap",
- "\psmile",
- "\psmirk",
- "\psmithereens",
- "\psmithy",
- "\psocial",
- "\psociety",
- "\psophistry",
- "\psophomore",
- "\psoprano",
- "\pspecify",
- "\pspecimen",
- "\pspecious",
- "\pspeckle",
- "\pspokesmen",
- "\psponge",
- "\psponsor",
- "\pspontaneity",
- "\pstable",
- "\pstableman",
- "\pstaccato",
- "\pstealthy",
- "\psteam",
- "\psteamboat",
- "\psteed",
- "\pstonewall",
- "\pstoneware",
- "\pstonewort",
- "\pstony",
- "\pstrontium",
- "\pstrophe",
- "\pstrove",
- "\psuccumb",
- "\psuch",
- "\psuckling",
- "\psuperstition",
- "\psupervene",
- "\psupervisory",
- "\psupine",
- "\psweepstake",
- "\psweetheart",
- "\pswell",
- "\psystematic",
- "\psystemic",
- "\ptapping",
- "\ptarantula",
- "\pteleost",
- "\ptelepathic",
- "\ptelephone",
- "\ptestimony",
- "\ptesty",
- "\pthieves",
- "\pthigh",
- "\pthimble",
- "\pthreadbare",
- "\ptiara",
- "\ptibia",
- "\ptick",
- "\pticket",
- "\ptickle",
- "\ptolerant",
- "\ptoll",
- "\ptollhouse",
- "\ptownhouse",
- "\ptownsman",
- "\ptoxic",
- "\ptoxicology",
- "\ptrap",
- "\ptrapezium",
- "\ptrapezoid",
- "\ptrip",
- "\ptripartite",
- "\ptripe",
- "\ptriple",
- "\ptriplet",
- "\ptumultuous",
- "\ptuna",
- "\ptundra",
- "\ptune",
- "\ptyranny",
- "\pupshot",
- "\pupstair",
- "\pvanguard",
- "\pvanilla",
- "\pvanish",
- "\pvanity",
- "\pvanquish",
- "\pvertical",
- "\pvertices",
- "\pvertigo",
- "\pvery",
- "\pvirtue",
- "\pviscount",
- "\pviscous",
- "\pvise",
- "\pvisible",
- "\pwail",
- "\pwaist",
- "\pwaistcoat",
- "\pwaistline",
- "\pwaterproof",
- "\pwatershed",
- "\pwaterway",
- "\pwatery",
- "\pwheat",
- "\pwheedle",
- "\pwheel",
- "\pwheelbase",
- "\pwield",
- "\pwiener",
- "\pwife",
- "\pwindbag",
- "\pwoebegone",
- "\pwoke",
- "\pwring",
- "\pwrinkle",
- "\pwrist",
- "\pyule",
- "\pzero",
- "\pzinc",
- "\pzucchini",
- "\pzygodactyl"
- };
-
- static short wOrder[maxWords];
- static short wIndex = maxWords;
-
-
- unsigned char *
- PickWord (void)
- {
- short i, j, n;
-
- if (wIndex >= maxWords)
- {
- /*
- * Initialize the array with the values 0 .. maxWords-1.
- * Randomize it by walking through it one element at a time,
- * swapping the contents of each element with a randomly chosen
- * other element. This pretty much ensures that each element
- * is swapped at least once (though not necessarily), and takes
- * time linearly related to the length of the array.
- */
-
- for (i = 0; i < maxWords; ++i)
- wOrder[i] = i;
- for (i = 0; i < maxWords; ++i)
- {
- j = BlobRand (maxWords - 1);
- n = wOrder[i];
- wOrder[i] = wOrder[j];
- wOrder[j] = n;
- }
-
- wIndex = 0;
- }
-
- return (word[wOrder[wIndex++]]);
- }
-